add_message("\nBy using the command 'I', a program is run which will\n");
add_message("automatically indent all lines in your code. As this is\n");
add_message("being done, the program will also search for some basic\n");
add_message("errors (which don't show up good during compiling) such as\n");
add_message("Unterminated String, Mismatched Brackets and Parentheses,\n");
add_message("and indented code is easy to understand and debug, since if\n");
add_message("your brackets are off -- the code will LOOK wrong. Please\n");
add_message("mail me at gaunt@mcs.anl.gov with any pieces of code which\n");
add_message("don't get indented properly.\n");
break;
#if 0
case '^':
add_message("Command: ^ Usage: ^pattern\n");
add_message("This command is similiar to grep, in that it searches the\n");
add_message("entire file, printing every line that contains the specified\n");
add_message("pattern. To get the line numbers of found lines, turn on line\n");
add_message("number printing with the 'n' command.\n");
break;
#endif
case 'n':
add_message("Command: n Usage: n\n");
add_message("This command toggles the internal flag which will cause line\n");
add_message("numbers to be printed whenever a line is listed.\n");
break;
case 'a':
add_message("Command: a Usage: a\n");
add_message("Append causes the editor to enter input mode, inserting all text\n");
add_message("starting AFTER the current line. Use a '.' on a blank line to exit\n");
add_message("this mode.\n");
break;
case 'A':
add_message("Command: A Usage: A\n\
Like the 'a' command, but uses inverse autoindent mode.\n");
break;
case 'i':
add_message("Command: i Usage: i\n");
add_message("Insert causes the editor to enter input mode, inserting all text\n");
add_message("starting BEFORE the current line. Use a '.' on a blank line to exit\n");
add_message("this mode.\n");
break;
case 'c':
add_message("Command: c Usage: c\n");
add_message("Change command causes the current line to be wiped from memory.\n");
add_message("The editor enters input mode and all text is inserted where the previous\n");
add_message("line existed.\n");
break;
case 'd':
add_message("Command: d Usage: d or [range]d\n");
add_message("Deletes the current line unless preceeded with a range of lines,\n");
add_message("then the entire range will be deleted.\n");
break;
case 'e':
add_message("Commmand: e Usage: e filename\n");
add_message("Causes the current file to be wiped from memory, and the new file\n");
add_message("to be loaded in.\n");
break;
case 'E':
add_message("Commmand: E Usage: E filename\n");
add_message("Causes the current file to be wiped from memory, and the new file\n");
add_message("to be loaded in. Different from 'e' in the fact that it will wipe\n");
add_message("the current file even if there are unsaved modifications.\n");
break;
case 'f':
add_message("Command: f Usage: f or f filename\n");
add_message("Display or set the current filename. If filename is given as \nan argument, the file (f) command changes the current filename to\nfilename; otherwise, it prints the current filename.\n");
break;
case 'g':
add_message("Command: g Usage: g/re/p\n");
add_message("Search in all lines for expression 're', and print\n");
add_message("every match. Command 'l' can also be given\n");
add_message("Unlike in unix ed, you can also supply a range of lines\n");
add_message("to search in\n");
add_message("Compare with command 'v'.\n");
break;
case 'h':
add_message("Command: h Usage: h or hc (where c is a command)\n");
add_message("Help files added by Qixx.\n");
break;
case 'j':
add_message("Command: j Usage: j or [range]j\n");
add_message("Join Lines. Remove the NEWLINE character from between the two\naddressed lines. The defaults are the current line and the line\nfollowing. If exactly one address is given, this command does\nnothing. The joined line is the resulting current line.\n");
break;
case 'k':
add_message("Command: k Usage: kc (where c is a character)\n");
add_message("Mark the addressed line with the name c, a lower-case\nletter. The address-form, 'c, addresses the line\nmarked by c. k accepts one address; the default is the\ncurrent line. The current line is left unchanged.\n");
break;
case 'l':
add_message("Command: l Usage: l or [range]l\n");
add_message("List the current line or a range of lines in an unambiguous\nway such that non-printing characters are represented as\nsymbols (specifically New-Lines).\n");
break;
case 'm':
add_message("Command: m Usage: mADDRESS or [range]mADDRESS\n");
add_message("Move the current line (or range of lines if specified) to a\nlocation just after the specified ADDRESS. Address 0 is the\nbeginning of the file and the default destination is the\ncurrent line.\n");
break;
case 'p':
add_message("Command: p Usage: p or [range]p\n");
add_message("Print the current line (or range of lines if specified) to the\nscreen. See the command 'n' if line numbering is desired.\n");
break;
case 'q':
add_message("Command: q Usage: q\n");
add_message("Quit the editor. Note that you can't quit this way if there\nare any unsaved changes. See 'w' for writing changes to file.\n");
break;
case 'Q':
add_message("Command: Q Usage: Q\n");
add_message("Force Quit. Quit the editor even if the buffer contains unsaved\nmodifications.\n");
break;
case 'r':
add_message("Command: r Usage: r filename\n");
add_message("Reads the given filename into the current buffer starting\nat the current line.\n");
break;
case 't':
add_message("Command: t Usage: tADDRESS or [range]tADDRESS\n");
add_message("Transpose a copy of the current line (or range of lines if specified)\nto a location just after the specified ADDRESS. Address 0 is the\nbeginning of the file and the default destination\nis the current line.\n");
break;
case 'v':
add_message("Command: v Usage: v/re/p\n");
add_message("Search in all lines without expression 're', and print\n");
add_message("every match. Other commands than 'p' can also be given\n");
add_message("Compare with command 'g'.\n");
break;
case 'z':
add_message("Command: z Usage: z or z- or z.\n");
add_message("Displays 20 lines starting at the current line.\nIf the command is 'z.' then 20 lines are displayed being\ncentered on the current line. The command 'z-' displays\nthe 20 lines before the current line.\n");
break;
case 'Z':
add_message("Command: Z Usage: Z or Z- or Z.\n");
add_message("Displays 40 lines starting at the current line.\nIf the command is 'Z.' then 40 lines are displayed being\ncentered on the current line. The command 'Z-' displays\nthe 40 lines before the current line.\n");
break;
case 'x':
add_message("Command: x Usage: x\n");
add_message("Save file under the current name, and then exit from ed.\n");
break;
case 's':
if ( *inptr=='e' && *(inptr+1)=='t' ) {
add_message("\
Without arguments: show current settings.\n\
'set save' will preserve the current settings for subsequent invocations of ed.\n\
Options:\n\
\n\
number will print line numbers before printing or inserting a lines\n\
list will print control characters in p(rint) and z command like in l(ist)\n\
print will show current line after a single substitution\n\
eightbit\n\
autoindent will preserve current indentation while entering text.\n\
use ^D or ^K to get back one step back to the right.\n\
excompatible will exchange the meaning of \\( and ( as well as \\) and )\n\
\n\
An option can be cleared by prepending it with 'no' in the set command, e.g.\n\
'set nolist' to turn off the list option.\n\
\n\
set shiftwidth <digit> will store <digit> in the shiftwidth variable, which\n\
determines how much blanks are removed from the current indentation when\n\
typing ^D or ^K in the autoindent mode.\n");
break;
} else ;
/* is there anyone who wants to add an exact description for the 's' command? */
case 'w':
case 'W':
case '/':
case '?':
add_message("Sorry no help yet for this command. Try again later.\n");